﻿#include "FITKAbaConstraintRigidBody.h"


Interface::FITKAbaAbstractConstraint::FITKAbaConstraintType Interface::FITKAbaConstraintRigidBody::getConstraintType() const
{
    return FITKAbaAbstractConstraint::FITKAbaConstraintType::RigidBody;
}

bool Interface::FITKAbaConstraintRigidBody::copy(FITKAbstractDataObject *obj)
{
    bool ok = FITKAbaAbstractConstraint::copy(obj);
    if (!ok)
        return false;
    FITKAbaConstraintRigidBody* rb = dynamic_cast<FITKAbaConstraintRigidBody*>(obj);
    if (rb == nullptr)
        return false;
    m_adjustPoint = rb->m_adjustPoint;
    m_constraintIsothermal = rb->m_constraintIsothermal;
    return true;
}

bool Interface::FITKAbaConstraintRigidBody::getAdjustPoint() const
{
    return m_adjustPoint;
}

void Interface::FITKAbaConstraintRigidBody::setAdjustPoint(bool state)
{
    m_adjustPoint = state;
}

bool Interface::FITKAbaConstraintRigidBody::getConstraintSelectedRegionToBeIsothermal() const
{
    return m_constraintIsothermal;
}

void Interface::FITKAbaConstraintRigidBody::setConstraintSelectedRegionToBeIsothermal(bool state)
{
    m_constraintIsothermal = state;
}

Interface::FITKBoundaryLocation *Interface::FITKAbaConstraintRigidBody::getReferencePoint()
{
    return this->getFirstLocation();
}

void Interface::FITKAbaConstraintRigidBody::setReferencePointNone()
{
    this->setLocationInvalid(0);
}

Interface::FITKBoundaryLocation *Interface::FITKAbaConstraintRigidBody::getBody()
{
    return this->getSecondLocation();
}

void Interface::FITKAbaConstraintRigidBody::setBodyNone()
{
    this->setLocationInvalid(1);
}

Interface::FITKBoundaryLocation *Interface::FITKAbaConstraintRigidBody::getPin()
{
    return this->getLocationAt(2);
}

void Interface::FITKAbaConstraintRigidBody::setPinNone()
{
    this->setLocationInvalid(2);
}

Interface::FITKBoundaryLocation *Interface::FITKAbaConstraintRigidBody::getTie()
{
    return this->getLocationAt(3);
}

void Interface::FITKAbaConstraintRigidBody::setTieNone()
{
    this->setLocationInvalid(3);
}

Interface::FITKBoundaryLocation *Interface::FITKAbaConstraintRigidBody::getAnalyticalSurface()
{
    return this->getLocationAt(4);
}

void Interface::FITKAbaConstraintRigidBody::setAnalyticalSurfaceNone()
{
    this->setLocationInvalid(4);
}
